def fun1(n):
    res = 1
    i = 1
    while i <= n:
        res = res * i
        i += 1
    return res

def fun2(e):
    res01 = 0
    i = 1
    while i <= (e):
        res01 += fun1(i)
        i += 1+3
    return res01
result = fun2(50)
print(result)